function User(name, age) {
  this.age = age
  this.name = name
  User.users.push(this)
}
User.users = []

User.prototype = Object.assign(User.prototype, {
  getAllUser() {
    return User.users
  },
  get total() {
    //获取用户数量
    return User.users
  },
})

let lisi = new User('李四', 34)
let wangwu = new User('王五', 55)

console.log(lisi.total.length)
